home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 5
/
Amiga Tools 5.iso
/
tools
/
developer-tools
/
andere sprachen
/
python-1.3
/
readme
< prev
next >
Wrap
Text File
|
1996-07-16
|
16KB
|
382 lines
PYTHON 1.3 RELEASE 4
NOTES ON THE AMIGA PORT
Release date: July 2, 1996.
Conversion and Amiga specific code by Irmen de Jong.
(Original code by Guido van Rossum and others)
Read the file <DISCL_and_COPYRIGHT>!
It contains the disclaimer for this software, and copyright notices.
Contents:
~~~~~~~~~
1. What's new?
2. General remarks.
3. Troubleshooting.
4. Future.
5. Modification history.
+----------------------+
| |
| 1. What's new? |
| |
+----------------------+
IMPORTANT CHANGES SINCE THE PREVIOUS VERSION (9-Apr-96):
* Fixed bugs:
rewrote env handling (os.environ etc) and environ module
now using correct pool library
removed debug message in os.link
removed memory leak bug in lstat
fixed os.curdir string
fixed import, now accepts paths like 'RAM:' in sys.path
fixed return value of chown function
fixed time.strftime arguments
better stack management
* Completed filesystem link support in amigamodule.
You now have os.link, os.symlink and os.readlink. So you can now make
hardlinks and softlinks, using os.link and os.symlink, respectively. You
can read the value of a symbolic (soft) link using os.readlink. Bear in
mind that the filesystem must support links (2.04+ FFS does) All three
functions are designed for compatibility with their Posix equivalents.
NOTE: because of implementation issues, os.readlink fails when passing
only a device name as argument. This is not a big problem (devices can
never be links anyway).
* Included latest cgi.py and urllib.py modules. The old versions are still
available as cgi.py_old and urllib.py_old.
* Tempfile's tempdir is now 'T:' instead of current dir.
* Moved some modules in the lib directory to 'NON-Amiga'.
* Replacement modules for `posixpath' and `posix'. They just import
`amigapath' and `amiga' but make some other files work!
* Added fullpath function in ospath/amigapath module.
* Improved mkdir function: now actually pays attention to the protection
flags (and even your umask).
* Rewrote amiga.listdir with dos.library calls (smaller & faster)
* Improved select module; select.select() now takes an optional 5th argument,
which is a signal mask to wait on (select is now done using AmiTCP's
WaitSelect() ). When the signal mask is not zero, select will return a
4-tuple (instead of the usual 3-tuple) in which the 4th element is the
signal mask of the signals that occured. If no signals occured it is zero,
ofcourse. Hint: pass `None' for the 4th argument (timeout value) if you
want no timeouts.
* Better stack management:
- Increased stack in Python icon to 20000.
- Increased default stack to 18000. (15000 was too small for me)
- Added explicit stack check code. You'll now get a MemoryError
exception instead of a crash, hopefully :-)
* Included recent FAQ: Version: 1.29++, 7 March 1996
1A. About the new environment handling:
--------------------------------------------------------
DESCRIPTION OF ENVIRONMENT BUG, AND THE FIXES
Mike Meyer (mwm@contessa.phone.net) told me that the new way of handling
the environment variables broke the portability of CGI scripts. This is
because the local environment variables have been removed from the
os.environ dictionary. Mike's problem convinced me that this was a Bad
Move (tm) and thus I decided to re-do the environment handling.
REWRITE OF ENVIRONMENT HANDLING
The os.environ dictionary now (again!) cointains BOTH GLOBAL (ENV:) AND
LOCAL (shell-) variables. This fixes the CGI portability problems. The
following relevant dictionaries are now defined:
os.environ - contains both global (ENV:) and local vars (! CHANGED !)
If a variable occurs both as global and as local var,
the local value is taken.
os.globalvars - contains GLOBAL (ENV:) variables ONLY (! NEW !)
os.shellvars - contains LOCAL (shell-) variables ONLY
os.shellaliases - contains shell aliases
REWRITE OF THE environment MODULE
Because this module is not defined in the Python docs I assume there is no
requirement for it being Posix compliant or portable. Hence I rewrote the
whole module. It now consists of:
putenv - putenv(str) !!! CHANGED !!!
DOES: Put new global (ENV:) environment variable.
ARGS: str: string of the form "name=value".
RETURNS: nothing.
NOTE: The previous putenv calls (putenv("name","value") should
be changed to: setenv("name","value",1)
getenv - value=getenv(name)
DOES: Get value of global (ENV:) environment variable.
ARGS: string which is the variable to get.
RETURNS: value of the variable (string), or None if the var
doesn't exist.
setenv - setenv(name,value,overwrite)
DOES: Set global (ENV:) environment variable.
ARGS: name=name of variable to set (string)
value=value for this var (string)
overwrite=boolean flag (0/1) indicating if the value
should be overwritten if the var already exists.
RETURNS: nothing.
unsetenv - unsetenv(name)
DOES: removes a global (ENV:) environment variable.
ARGS: string which is the name of the var to remove
RETURNS: nothing.
setvar - setvar(name,value,overwrite)
DOES: see setenv, but on local (shell) var instead of global!
getvar - getvar(name)
DOES: see getenv, but on local (shell) var instead of global!
unsetvar - unsetvar(name)
DOES: see unsetenv, but on local (shell) var only, not global!
All 7 functions are implemented using the dos.library's variable calls, to
keep code short. Empty environment variables ('' - the empty string) are
also accepted.
+----------------------+
| |
| 2. General remarks |
| |
+----------------------+
* All tests in Lib/test ran successfully with my version.
To try it yourself, type:
cd Python:lib/test
//Python
(now enter `import autotest' at the prompt. Should report 'all tests OK')
* To check some command line options, use the -? option, or any other
unrecognised option.
* The default PYTHONPATH is ";Python:lib", so when looking for modules,
python first checks the current directory, then Python:lib. By setting the
global environment variable PYTHONPATH to f.i. "WORK:pylib", the module
search path becomes WORK:pylib, then the current directory, then
Python:lib.
* The `Docs' directory contains 2 text files regarding regular expression
syntax, and some other documents. You might want to copy other python
documentation in here.
* The following modules are built in into this release:
amiga, array, binascii, crypt, environment, grp, imp,
marshal, math, md5, new, pwd, regex, rotor, select, socket,
soundex, strop, struct, sys, syslog, time.
Amiga specific: amiga (amiga version of posix module)
Needs usergroup.library: crypt, grp, pwd.
Needs AmiTCP's bsdsocket.library: select, socket, syslog.
Check the python documentation to see what each module offers.
* Mail me if you encounter any Amiga specific problems, or if you have any
Amiga related questions about Python, or just for fun. More general
questions are better asked on the usenet newsgroup comp.lang.python. A lot
of information, including an online manual, can be obtained from
<http://www.python.org/> or <http://www.cwi.nl/www.python.org/> if your
site is close to the Netherlands. Read the FAQ before asking!
2A. About the networking support (through AmiTCP):
--------------------------------------------------------
The python binary is compiled with AmiTCP support. The interpreter still
works even if you don't have AmiTCP, but the extra functionality (mainly
the socket module) can't be used without AmiTCP (obviously). Some extra
functions already work if you only have the usergroup.library, and not the
full AmiTCP package: the crypt, pwd and grp modules for instance. A
MultiuserFileSystem-compatible usergroup.library can be found on Aminet
(didn't try it -- beware). Usergroup.library can also be found in the demo
version of AmiTCP, which is also on Aminet.
2B. About os.path.split (amigapath.split):
--------------------------------------------------------
The documentation for this function differs a bit from the unix behavior:
" Split a path in head (everything up to the last '/' or ':') and tail (the
rest). If the path ends in '/' or ':', tail will be empty. If there is no
'/' or ':' in the path, head will be empty. DIFFERENCE WITH posixpath:
only ONE trailing '/' will be stripped from head! (on the Amiga a double
slash means "parent dir"! ) This means that if head ends in a '/', you
MUST add a '/' to it when reconstructing the path, or you will lose the
"parent dir" slash. Functions that depend on this function are also
affected! (basename, dirname) "
(Suggested by Kent Polk, kent@eaenki.nde.swri.edu)
2C. About Timezones:
--------------------------------------------------------
As another side-effect of linking in AmiTCP stuff, Python extracts the
timezone information from your current locale preferences. No need anymore
for a TZ environment var. (One small problem: the name of the timezone is
no longer known, and is replaced by '???'.) If the locale prefs couldn't be
read, the timezone information is taken from ENV:TZ, which must be a string
like 'MET-1' (MET, -1 hour from GMT).
+-----------------------+
| |
| 3. Troubleshooting |
| |
+-----------------------+
* When I try to install Python, I get "Unable to open your tool
'installer'"!
The Installer® utility is required for installation, but it is not included
in the archive. You can find it on your original installation disks that
came with your computer (or copy it from somewhere else). You must copy it
to your C: directory, or somewhere else where the Workbench can find it.
* When I start python, I get "This program requires a math co-processor"!
You have installed the wrong version. Choose the version with IEEE math.
* Python seems so slow!
This is because Python is an interpreted language. Some programs execute
slow because of this. Other programs can run fast, because they are written
better, or make heavy use of the fast built-in (compiled) modules. Keep in
mind that function calls in Python have quite big overhead.
* I get "Couldn't open bsdsocket.library" or "Couldn't open
usergroup.library" errors!
You are trying to use functions that need one of these libraries. AmiTCP
is required if you want to use all (network) functions.
* Python crashes when executing complex (recursive) code!
Your stack size is too low. Python sets it's stack to 18K if your stack
size setting is less than that. In some (rare) cases, 18K may not be
enough. Increase the stack size in such cases. The needed stack depends
on the complexity of the program. Python was compiled without dynamic
stack-checking because I didn't want to slow it down. However, since
release 4 you'll get a MemoryError exception instead of a crash (hopefully)
if your stack appears too small.
+----------------------+
| |
| 4. Future |
| |
+----------------------+
An experimental high-level Python <-> AREXX interface is being tested.
This will be major! Imagine controlling your apps from Python, and
controlling Python from AREXX!
Currently I am busy extending the interpreter with an API to the Amiga
shared libraries. In the end this will result in a bunch of modules, one
for each library, providing the Amiga Python programmer with an interface
to the Amiga shared libraries. Because I ran into some problems regarding
C structures, C strings and C pointers, and their integration into Python,
the release of all this is delayed some time (unknown). Sorry.
Support for I-Net 225, another networking package, is considered.
IMPORTANT:
Please let me know if you find an error, encounter problems, or have any
suggestions! But, as I do this in my spare time, don't expect miracles...
+---------------------------+
| |
| 5. Modification history |
| |
+---------------------------+
10 dec. 1995 - 1st public release.
13 dec. 1995 - 2nd public release.
Darn. 1st version was compiled with a wrong version of
memory pools library (Caused crash/wrong behavior on
anything less than Kick 3.0) -- FIXED (uses amiga.lib now).
10 jan. 1996 - internal
* Phew. Added (a lot of) prototypes; the whole thing now compiles
with register arguments instead of stack arguments!
* Removed binascii module (who uses this?)
* Implemented os.popen and os.pipe (though the latter is of very
little use without fork() or threads).
* Implementes os.execv using Execute(). A bit of a hack; python only
quits after the new command finished.
2 apr. 1996 - internal
* Added AmiTCP support!
* Added many builtin modules, including binascii again ;)
* amigapath.py library module (os.path) changed, especially the split
function and the expanduser function. Check the source for details.
* Replaced lib/stat.py by original version (Unix-compatible)
* Fixed typo in 'usage' text ('colon separated'->'semicolon separated')
* Some bugfixes. Most notably in environment module, and socket module.
* Enhanced environment module.
* Removed amiga.pipe (it is useless without threads) and amiga._exit.
Separated global & local environment dictionaries, and added a
shell aliases dictionary.
7 apr. 1996 - 3rd public release.
* Some minor changes. Fixed startup code to work with memory pools,
also when started from Workbench.
* Improved Installer® script.
20 may 1996 - internal
* Fixed bugs:
rewrote env handling (os.environ etc) and environ module
now using correct pool library
removed debug message in os.link
removed memory leak bug in lstat
* Completed the filesystem links support in amigamodule.
2 july 1996 - 4th public release.
* Fixed bugs:
fixed os.curdir string
fixed import, now accepts paths like 'RAM:' in sys.path
fixed return value of chown function
fixed time.strftime arguments
* Included latest cgi.py and urllib.py modules.
* Tempfile's tempdir is now 'T:' instead of current dir.
* Moved some modules in the lib directory to 'NON-Amiga'.
* Replacement modules for `posixpath' and `posix'.
* Added fullpath function in ospath/amigapath module.
* mkdir now actually pays attention to the protection flags and umask.
* Rewrote amiga.listdir with dos.library calls (smaller & faster)
* Improved select module; select.select() now takes an optional 5th
argument, which is an AmigaDOS signal mask to wait on.
* Better stack settings:
- Increased stack in Python icon to 20000.
- Increased default stack to 18000. (15000 was too small for me)
- Added explicit stack check code. You'll now get a MemoryError
exception instead of a crash, hopefully :-)
* Included more recent FAQ: Version: 1.29++, 7 March 1996
Irmen de Jong
(irmen@cs.vu.nl)